#include "table.h"

namespace Tetris{

Table::Table(){
	this->p_arr = new unsigned char[this->ROW * this->COL];
	this->clear();
}

void Table::clear(){
	int len = this->ROW * this->COL;
	for(int i=0; i<len; ++i)
		this->p_arr[i] = 0;
}

void Table::SetVal(int x,int y,unsigned char val){
	this->p_arr[x + y * this->COL] = val;
}

unsigned char Table::GetVal(int x,int y) const{
	return this->p_arr[x + y * this->COL];
}

}